define(['egis'], function (egis) {
    Window.deserializer = Window.deserializer || new egis.core.Deserializer();
    Window.container = Window.container || {};
    dsBridge.register('create_UniqueValueRenderer', function (sourceId, fieldName, labelField, showLabel, symbol) {
        var options = {
            symbol: Window.deserializer.createJsInstance(JSON.parse(symbol)),
            showLabel: showLabel || false,
            labelField: labelField,
            fieldName: fieldName
        };
        var uniqueValueRenderer = new egis.render.UniqueValueRenderer(options);
        Window.container[sourceId] = uniqueValueRenderer;
    })

    dsBridge.register('UniqueValueRenderer_addValue', function (sourceId, value, symbol) {
        var info = {
            value: value,
            symbol: Window.deserializer.createJsInstance(JSON.parse(symbol))
        }
        var uniqueValueRenderer = Window.container[sourceId];
        uniqueValueRenderer.addValue(info);
    })

    dsBridge.register('UniqueValueRenderer_setFielName', function (sourceId, fieldName) {
        var uniqueValueRenderer = Window.container[sourceId];
        uniqueValueRenderer.fieldName = fieldName;
    })

    dsBridge.register('UniqueValueRenderer_setLabelField', function (sourceId, labelField) {
        var uniqueValueRenderer = Window.container[sourceId];
        uniqueValueRenderer.labelField = labelField;
    })

    dsBridge.register('UniqueValueRenderer_setShowLabel', function (sourceId, showLabel) {
        var uniqueValueRenderer = Window.container[sourceId];
        uniqueValueRenderer.showLabel = showLabel;
    })

    dsBridge.register('UniqueValueRenderer_setSymbol', function (sourceId, symbol) {
        var uniqueValueRenderer = Window.container[sourceId];
        uniqueValueRenderer.symbol = Window.deserializer.createJsInstance(JSON.parse(symbol));
    })


})